<template>
  <div>
    个人中心
    <div class="btn-cont">
      <van-button type="danger" block @click="handleLogout"
        >退出登录</van-button
      >
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { useUserStore } from "../store/userStore";
const user = useUserStore();
const router = useRouter();
const handleLogout = () => {
  user.userInfo = null;
  router.push("/home");
};
</script>

<style scoped>
.btn-cont {
  padding: 20px;
}
</style>
